import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/system/menu/my`,
			name: "获取我的菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/system/menu/list`,
			name: "获取菜单",
			get: async function(){
				return await http.get(this.url);
			}
		},
		save: {
			url: `${config.API_URL}/system/menu/save`,
			name: "保存菜单",
			post: async function(data){
				return await http.post(this.url, data)
			}
		},
		remove: {
			url: `${config.API_URL}/system/menu/delete`,
			name: "删除菜单",
			post: async function(ids){
				return await http.post(this.url, ids)
			}
		}
	},
	dic: {
		tree: {
			url: `${config.API_URL}/system/dic/tree`,
			name: "获取字典树",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/system/dic/list`,
			name: "字典明细",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save: {
			url: `${config.API_URL}/system/dic/save`,
			name: "添加字典",
			exec: async function(data){
				return await http.post(this.url, data);
			}
		},
		saveDetail: {
			url: `${config.API_URL}/system/dic/saveDetail`,
			name: "添加字典",
			exec: async function(data){
				return await http.post(this.url, data);
			}
		},
		delete: {
			url: `${config.API_URL}/system/dic/delete/`,
			name: "删除字典",
			exec: async function(id){
				return await http.post(this.url+id);
			}
		},
		deleteDetail: {
			url: `${config.API_URL}/system/dic/deleteDetail`,
			name: "删除字典",
			exec: async function(data){
				return await http.post(this.url,data);
			}
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	role: {
		list: {
			url: `${config.API_URL}/system/role/list`,
			name: "获取所有角色",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save: {
			url: `${config.API_URL}/system/role/save`,
			name: "保存角色基本信息",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		pageList: {
			url: `${config.API_URL}/system/role/pageList`,
			name: "获取角色分页列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		delete: {
			url: `${config.API_URL}/system/role/delete/`,
			name: "获取角色分页列表",
			post: async function(id){
				return await http.post(this.url+id);
			}
		},
		getRes: {
			url: `${config.API_URL}/system/role/getRes`,
			name: "获取角色资源ID",
			exec: async function(param){
				return await http.get(this.url, param);
			}
		},
		setRes: {
			url: `${config.API_URL}/system/role/setRes`,
			name: "更新角色资源",
			exec: async function(data){
				return await http.post(this.url, data);
			}
		}, 
	},
	dept: {
		list: {
			url: `${config.API_URL}/system/dept/list`,
			name: "获取部门列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		save: {
			url: `${config.API_URL}/system/dept/save`,
			name: "保存部门信息",
			post: async function(data){
				return await http.post(this.url, data);
			}
		},
		remove: {
			url: `${config.API_URL}/system/dept/remove`,
			name: "删除部门信息",
			post: async function(ids){
				return await http.post(this.url, ids);
			}
		},
	},
	user: {
		list: {
			url: `${config.API_URL}/system/user/list`,
			name: "获取用户列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		create: {
			url: `${config.API_URL}/system/user/create`,
			name: '编辑用户',
			post: async function(data){
				return await http.post(this.url, data)
			}
		},
		save: {
			url: `${config.API_URL}/system/user/save`,
			name: '编辑用户',
			post: async function(data){
				return await http.post(this.url, data)
			}
		},
		delete: {
			url: `${config.API_URL}/system/user/delete`,
			name: '删除用户',
			post: async function(data){
				return await http.post(this.url, data)
			}
		}
	},
	app: {
		list: {
			url: `${config.API_URL}/system/app/list`,
			name: "应用列表",
			get: async function(){
				return await http.get(this.url);
			}
		}
	},
	log: {
		list: {
			url: `${config.API_URL}/system/log/list`,
			name: "日志列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	table: {
		list: {
			url: `${config.API_URL}/system/table/list`,
			name: "表格列管理列表",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		info: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
	tasks: {
		list: {
			url: `${config.API_URL}/system/tasks/list`,
			name: "系统任务管理",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	}
}
